package 进制转换.各位相加;

public class gwxj {
    public static void main(String[] args) {
        System.out.println(addDigits(121));
    }
    public static int addDigits(int num) {
        while (num / 10 != 0){
            num = num % 10 + num / 10;
        }
        return num;
    }
}
